package com.hx.order.dao;

import com.hx.common.domain.MqLog;
import com.hx.common.domain.OrderInfo;
import org.apache.ibatis.annotations.*;

/**
 * @Author wonghiu
 * @Date 2021/7/1 18:56
 * @Version 1.0.1
 */
@Mapper
public interface MqLogDao {
    @Insert("insert into mq_log(content,exchange,routing_key,class_type,state)values("
            + "#{content}, #{exchange}, #{routingKey}, #{classType}, #{state})")
    @SelectKey(keyColumn="id", keyProperty="id", resultType=int.class, before=false, statement="select last_insert_id()")
    public int insert(MqLog mqLog);

    @Update("update mq_log set content=#{content},exchange=#{exchange},routing_key=#{routingKey},class_type=#{classType},state=#{state} where id=#{id}")
    public void update(MqLog mqLog);

    @Select("select * from mq_log where id=#{Id}")
    public MqLog getById(@Param("Id")Integer id);
}
